<template>
  <div id="single-blog">
    <h1 v-rainbow>{{blog.title}}</h1>
    <article>
      {{blog.content}}
    </article>
  </div>
</template>

<script>
    export default {
        name: "SingleBlog",
      data(){
          return{
            id:this.$route.params.id,
            blog:{}
          }
      },
      created() {
          this.axios.get("/api/blog/single?id="+this.id)
            .then((data)=>{
            this.blog=data.data;
        })
      }
    }
</script>

<style scoped>
  #single-blog{
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #eee;
    border: 1px solid #aaa;
  }
</style>
